<?php
$this->Html->script(array('simplefoucs'), array('inline' => false));

// 字数截取函数
function csubstr($string, $start = 0,$sublen=12, $code = 'UTF-8',$ellipsis='...'){
 if($code == 'UTF-8'){
   $pa = "/[\x01-\x7f]|[\xc2-\xdf][\x80-\xbf]|\xe0[\xa0-\xbf][\x80-\xbf]|[\xe1-\xef][\x80-\xbf][\x80-\xbf]|\xf0[\x90-\xbf][\x80-\xbf][\x80-\xbf]|[\xf1-\xf7][\x80-\xbf][\x80-\xbf][\x80-\xbf]/";
   preg_match_all($pa, $string, $t_string);

   if(count($t_string[0]) - $start > $sublen) return join('', array_slice($t_string[0], $start, $sublen)).$ellipsis;
   return join('', array_slice($t_string[0], $start, $sublen));
 }else{
   $start = $start*2;
   $sublen = $sublen*2;
   $strlen = strlen($string);
   $tmpstr = '';
   for($i=0; $i<$strlen; $i++){
     if($i>=$start && $i<($start+$sublen)){
       if(ord(substr($string, $i, 1))>129) $tmpstr.= substr($string, $i, 2);
       else $tmpstr.= substr($string, $i, 1);
     }
     if(ord(substr($string, $i, 1))>129) $i++;
   }
   if(strlen($tmpstr)<$strlen ) $tmpstr.= $ellipsis;
   return $tmpstr;
 }
}
?>
   <div class="kh w">
     <img src="images/t_title.gif" width="680" height="18" alt="我们专注于移动设备，游戏，智能生活科技，互联网，软件等领域的用户体验设计。" />
   </div>

<!-- start banner 972 -->
<div class="bannerbox">
    <div id="focus">
        <ul>
            <?php foreach($bannerList as $i => $banner): ?> 
            <?php
		$images = json_decode($banner['Banner']['banner'], false);
		$img = ''; 
		if (!empty($banner['Banner']['banner']) ) {
		    $img = $banner['Banner']['banner'];
		} 
		if ($img == '') {
		    break; 
		}
            ?>
            <li>
            <?php echo $this->Html->link($this->Html->image('/'.$img, array('width'=>960, 'height'=>380)), $banner['Banner']['ref'], array('escape'=>false))?> 
            </li>
            <?php endforeach;?>
        </ul>
    </div>
</div>
<!-- start banner 962 -->

    <div class="design-sort w">
    <?php
    foreach ($serviceList as $i => $service) {
        //if ($service['Service']['icon']) {
            $class = 'fl';
            if ($i == 3) {
                $class = 'fl margin0';
            }
            echo $this->Html->link(
                $this->Html->image(
                    '/'.$service['Service']['icon'], 
                    array(
                        'width'=>230,
                        'height'=>120, 
                        'alt'=>$service['Service']['name']
                    )
                ),
                "/case/index/type:{$service['Service']['id']}",
                array('class'=>$class,'escape' => false)
            );
        //} 
    }
    ?>
   </div>
   <div class="clr"></div>

   <div class="w">
     <div class="fl customer">
       <h3><img src="images/t1.gif" width="111" height="17" alt="我们服务的客户" title="我们服务的客户" /></h3>
       <p>
奥迪 AUDI / 爱乐士科技 INEX / 深圳国际机场 / 南方人才网 / 凯立德 / BlazeVideo / 顺电百货 /  深圳粮食集团 / 东方银座美爵酒店 / 维纳传媒 / PIZUS 皮哲斯 / 九通正点 / 弘格科技
       </p>
        <p class='p1'>金之益地产 / 播客 BOKE / ENRICH / 香港百福珠宝 / 名邦地产 / Xlinksoft</p>
       <?php echo $this->Html->link('案例展示', '/case/index')?>
     </div>
    <div class="fl hots">
        <h3><img src="images/t2.gif" width="64" height="17" alt="新闻热点" title="新闻热点" /></h3>
        <?php foreach($newsList as $news): ?>
        <p>
            <?php
            echo $this->Html->link(
                $this->Html->image('/'.$news['News']['news_icon'], array('width'=>'90','height'=>'60')),
                    "/news/view/{$news['News']['id']}",
                    array('escape' => false)
                );
            echo $this->Html->link(csubstr($news['News']['title'],0,18), "/news/view/{$news['News']['id']}", array('class'=>'s1'));
            ?>
            <span class="s2"><?php echo csubstr($news['News']['news_memo'], 0, 32) ?>&nbsp;</span>
        </p>
        <?php endforeach; ?>
    </div>
    <div class="fl case">
        <h3><img src="images/t3.gif" width="64" height="17" alt="最新案例" title="最新案例" /></h3>
        <?php
        foreach($caseList as $i => $case) {
            if ($i>1) {
                continue;
            }
            echo $this->Html->link(
                $this->Html->image('/'.$case['Case']['home_img'], array('width'=>'240','height'=>'110')),
                    "/case/view/{$case['Case']['id']}",
                    array('escape' => false)
                );
        }
        ?>
    </div>
</div>

